const state = {
  template: {},
  activeIndex: 0
}

const mutations = {
  CHANGE_TEMPLATE: (state, data) => {
    state.template = data
  },
  CHANGE_ACTIVEINDEX: (state, index) => {
    state.activeIndex = index
  },
}

const actions = {
  changeTemplate ({ commit }, data) {
    commit('CHANGE_TEMPLATE', data)
  },
  changeActiveIndex ({ commit }, index) {
    commit('CHANGE_ACTIVEINDEX', index)
  },
}

export default {
  namespaced: true,
  state,
  mutations,
  actions,
}
